package com.example.turnonthelight;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        if(isHaveBluetooh()){
        	//Change to lightControll activity
        	Intent intent = new Intent(MainActivity.this, LightControll.class);
        	startActivity(intent);
        	finish();
        }else{
        	//warrning not support bluetooh
        }

       
    }
    
    private void showDialogNotHaveBuetooh(Context context){
    	
    }

    private Boolean isHaveBluetooh(){
    	PackageManager pm = getPackageManager();
    	Boolean hasBluetooh = pm
				.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH);
    	return hasBluetooh;
    }

}
